<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/14
 * Time: 10:30
 */
include_once '../tools/DbTools.php';
$moneyIn = $_POST['moneyIn'];
session_start();
$cardid = $_SESSION[$_COOKIE['Token']]['cardNum'];
$mag ='存款失败';
$url = 'moneyIn.php';
if ($moneyIn>0){
    DbTools::InitDb();
    $sql = "update bankcard set CardMoney =CardMoney+'$moneyIn' where CardNo='$cardid'";
    $bool = DbTools::noSelect($sql);
    DbTools::close();
    if ($bool){
        $mag='存款'.$moneyIn;
    }
}?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>用户中心</title>
</head>
<body>
<input type="hidden" name="" id="msg" value="<?php echo $mag ?>" />
<input type="hidden" name="" id="url" value="<?php echo $url ?>" />
</body>
<script type="text/javascript">
    onload = function(){
        var url = document.getElementById('url').value;
        var mag = document.getElementById('msg').value;
        alert(mag);
        location.href = url;
    }
</script>
</html>
